package cn.jdy.plugins.service;

import java.util.HashMap;
import java.util.Map;

import org.hibernate.SQLQuery;
import org.springframework.stereotype.Service;

import cn.jdy.framework.db.hibernate.BaseDao;
import cn.jdy.plugins.entity.Cities;

@Service
public class CitiesService extends BaseDao<Cities> {

	/**
	 * 获取当前对应地区的总数
	 * @param name
	 * @return
	 */
	public Map<String, Object> getnums(String name) {
		Map<String, Object> map = new HashMap<String, Object>();
	    String sql = "SELECT "+name+" FROM cities WHERE id ='1'";
	    SQLQuery query = super.em().createSQLQuery(sql.toString());
	    map.put("dataList", query.list());
	    return map;
	  }
}
